package com.yanyilu.qiubite.jpa;

import com.yanyilu.qiubite.entity.Spot;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface SpotJpa extends JpaRepository<Spot,Integer> {
    @Query(value = "select * from spot where app_id = :appId",nativeQuery = true)
    Spot findByAppId(@Param("appId") String appId);

    @Query(value = "select spot_name from spot where spot_id = :spotId",nativeQuery = true)
    String findSpotNameBySpotId(@Param("spotId")Integer spotId);
}
